<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%>
<%@ page import="net.sureon.dao.*"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="net.sureon.common.DateFormat"%>
<%@page import="net.sureon.common.I18nSupport"%>

<%
	List<Application> all = null;
	all = (List<Application>) request.getAttribute("all");
%>
<%
int currentPage = (Integer)request.getAttribute("currentPage");
int pageCounter = (Integer)request.getAttribute("pageCounter");
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml">
	<HEAD>
		<TITLE>我的申请</TITLE>
		<META http-equiv=Content-Type content="text/html; charset=utf-8">
		<META content="MSHTML 6.00.5730.13" name=GENERATOR>
	</HEAD>
	<BODY>
		<jsp:include page="../header.jsp"></jsp:include>
		<DIV>
			<TABLE class=style1 cellSpacing=0 cellPadding=0>
				<TBODY>

					<TR>
						<TD colSpan=2>
							<TABLE class=style5 cellSpacing=0 cellPadding=0>
								<TBODY>
									<TR>
										<TD class=style6 style="TEXT-ALIGN: left" bgColor=#fffbd6>
											<TABLE class=ctl00_ContentPlaceHolder1_Menu1_2
												id=ctl00_ContentPlaceHolder1_Menu1 cellSpacing=0
												cellPadding=0 border=0>
												<TBODY>
													<TR>
														<TD id=ctl00_ContentPlaceHolder1_Menu1n1
															onkeyup=Menu_Key(this) onmouseover=Menu_HoverStatic(this)
															onmouseout=Menu_Unhover(this)>
															<TABLE class=ctl00_ContentPlaceHolder1_Menu1_4
																cellSpacing=0 cellPadding=0 width="100%" border=0>
																<TBODY>
																	<TR>
																		<TD style="WHITE-SPACE: nowrap">
																			<A
																				class="ctl00_ContentPlaceHolder1_Menu1_1 ctl00_ContentPlaceHolder1_Menu1_3"
																				href="<%=request.getContextPath() %>/user/myApplication.do">可编辑的申请</A>
																			<br />
																		</TD>
																	</TR>
																</TBODY>
															</TABLE>
														</TD>

														<TD style="WIDTH: 3px"></TD>

														<TD id=ctl00_ContentPlaceHolder1_Menu1n0
															onkeyup=Menu_Key(this) onmouseover=Menu_HoverStatic(this)
															onmouseout=Menu_Unhover(this)>
															<TABLE
																class="ctl00_ContentPlaceHolder1_Menu1_4 ctl00_ContentPlaceHolder1_Menu1_9"
																cellSpacing=0 cellPadding=0 width="100%" border=0>
																<TBODY>
																	<TR>
																		<TD style="WHITE-SPACE: nowrap">
																			<A
																				class="ctl00_ContentPlaceHolder1_Menu1_1 ctl00_ContentPlaceHolder1_Menu1_3 ctl00_ContentPlaceHolder1_Menu1_8"
																				href="<%=request.getContextPath() %>/user/myConfirmApplication.do">已批准的申请</A>
																		</TD>
																	</TR>
																</TBODY>
															</TABLE>
														</TD>
													</TR>
												</TBODY>
											</TABLE>
										</TD>
									</TR>
										
									<TR>
											<TD style="TEXT-ALIGN: left">
												<TABLE class=style5 cellSpacing=0 cellPadding=0 width="1170">
													<TBODY>
														<TR>
															<TD style="TEXT-ALIGN: left">
																<DIV>
																	<TABLE id=ctl00_ContentPlaceHolder1_GridView2
																		style="FONT-SIZE: small; WIDTH: 100%; COLOR: #333333; FONT-FAMILY: Arial; BORDER-COLLAPSE: collapse"
																		cellSpacing=0 cellPadding=4 border=0>
																		<TBODY>
																			<TR
																				style="FONT-WEIGHT: bold; COLOR: white; BACKGROUND-COLOR: #507cd1"
																				align=middle>
																				<TH scope=col style="COLOR: white">
																					申请类别
																				</TH>
																				<TH scope=col style="COLOR: white">
																					开始日期
																				</TH>
																				<TH scope=col style="COLOR: white">
																					结束日期
																				</TH>
																				<TH scope=col style="COLOR: white">
																					累计时长
																				</TH>
																				<TH scope=col style="COLOR: white">
																					说明
																				</TH>
																				<TH scope=col style="COLOR: white">
																					提交时间
																				</TH>
																				<th scope="col" style="color: White;">
																					批准日期
																				</th>
																				<th scope="col" style="color: White;">
																					批准人
																				</th>
																			</TR>



																			<!-- 通过循环所有的本人所有的申请信息 -->
																			<%
																				if (all == null || all.size() == 0) {
																			%>
																			<%
																				} else {
																					String bgColor=null;
																					String color_a = "#FFFFFF";
																					String color_b = "#EFF3FB";
																					for (int i = 0; i < all.size(); i++) {
																						bgColor = (i%2 == 0)?color_a:color_b;
																						Application app = (Application) all.get(i);
																						java.text.DecimalFormat df = new java.text.DecimalFormat(
																								"####");
																			%>
																			<TR style="BACKGROUND-COLOR: <%=bgColor%>" align=middle>
																				<TD style="WIDTH: 60px">
																				<a href="<%=request.getContextPath() %>/user/myConfirmApplication.do?showContent=true&applicationID=<%=app.getApplicationID() %>">
																					<%=I18nSupport.getMessage(app.getCategory()) %>
																				</a>
																				</TD>
																				
																				<TD style="WIDTH: 75px"><%=app.getStartDate()%></TD>
																				<TD style="WIDTH: 75px"><%=app.getEndDate()%></TD>
																				<TD style="WIDTH: 60px"><%=df.format(app.getSumTime())%></TD>
																				<TD>
																					<%
																						String note = app.getReviewNote();
																						if(note.length() > 73){
																							note = note.substring(0, 70);
																							note = note + "...";
																						}
																						out.print(note);
																						
																					 %>
																				</TD>
																				<TD style="WIDTH: 75px"><%=DateFormat.formatToSimple(app.getSubmitDate())%></TD>
																				<TD style="WIDTH: 60px"><%=DateFormat.formatToDetail(app.getReviewDate())%></TD>
																				<TD style="WIDTH: 60px"><%=app.getReviewer().getRealName() == null ? "无" : app.getReviewer().getRealName()%></TD>
																			</TR>
																			<%
																				}
																				}
																			%>
																		</TBODY>
																	</TABLE>
																</DIV>
															</TD>
														</TR>
													<TR>
														<TD style="TEXT-ALIGN: center">
															<jsp:include page="../splitPage.jsp">
																<jsp:param name="url" value="/user/myConfirmApplication.do"/>
																<jsp:param name="currentPage" value="<%=currentPage %>"/>
																<jsp:param name="pageCounter" value="<%=pageCounter %>"/>
															</jsp:include>
														</TD>
													</TR>
												</TBODY>
											</TABLE>
											</TD>
											</TR>
								<FORM id=aspnetForm name=aspnetForm
								action="<%=request.getContextPath()%>/user/processApplication.do"
								method=post>
								
									<TR>
										<TD>
											<DIV id=ctl00_ContentPlaceHolder1_Panel1>
												<TABLE class=style5 cellSpacing=0 cellPadding=0 width="689"
													height="90">
													<TBODY>
														<%
															Application app = (Application)request.getAttribute("application");
															if(app != null) {															
														 %>
													 <TR>
															<TD style="TEXT-ALIGN: left">
																<SPAN id=ctl00_ContentPlaceHolder1_Label4
																	style="FONT-SIZE: small">申请类别：</SPAN>
																	<SELECT
																			id=ctl00_ContentPlaceHolder1_DropDownList1
																			style="HEIGHT: 20px" name="category">
																														
																			<OPTION value="Over" <%="Over".equals(app.getCategory()) ? "selected" : "" %>>
																					加班
																			</OPTION>
																			<OPTION value="Vocation" <%="Vocation".equals(app.getCategory()) ? "selected" : "" %>>
																				休假
																			</OPTION>
																			<OPTION value="Leave" <%="Leave".equals(app.getCategory()) ? "selected" : "" %>>
																				请假
																			</OPTION>
																			<OPTION value="BusinessTrip" <%="BusinessTrip".equals(app.getCategory()) ? "selected" : "" %>>
																				出差
																			</OPTION>
																													
																	</SELECT>
															</TD>
															<TD style="TEXT-ALIGN: left">
																<SPAN id="xxxxxxxx" style="FONT-SIZE: small">开始日期：</SPAN>
																<INPUT id="startDate"
																	style="FONT-SIZE: small; WIDTH: 86px; HEIGHT: 16px"
																	value="<%=new java.text.SimpleDateFormat("yyyy-MM-dd").format(app.getStartDate())%>"
																	name="startDate">
															</TD>
															<TD style="TEXT-ALIGN: left">
																<SPAN id="yyyyy" style="FONT-SIZE: small">结束日期：</SPAN>
																<INPUT id="endDate"
																	style="FONT-SIZE: small; WIDTH: 86px; HEIGHT: 16px"
																	value="<%=new java.text.SimpleDateFormat("yyyy-MM-dd").format(app.getEndDate())%>"
																	name="endDate">
															</TD>
															<TD style="TEXT-ALIGN: right">
																<SPAN id=ctl00_ContentPlaceHolder1_Label7
																	style="FONT-SIZE: small">累计时长：</SPAN>
																<INPUT id=ctl00_ContentPlaceHolder1_TextBox3
																	style="FONT-SIZE: small; WIDTH: 30px; HEIGHT: 16px"
																	value=<%=app.getSumTime() %> name=sumTime>
																<SPAN id=ctl00_ContentPlaceHolder1_Label8
																	style="FONT-SIZE: small">小时</SPAN>
															</TD>
														</TR>
														<TR>
															<TD colSpan=4>
																<TEXTAREA id=ctl00_ContentPlaceHolder1_TextBox4
																	style="FONT-SIZE: small; WIDTH: 99.5%; HEIGHT: 80px"
																	name="note"><%=app.getReviewNote() %></TEXTAREA>
															</TD>
														</TR>
													 
													 <%
													 	}
													  %>
												   <%-- 
														<TR>
															<input type="hidden" name="status" value="Pending" />
															<TD style="TEXT-ALIGN: center" colSpan=4>
																<INPUT id=ctl00_ContentPlaceHolder1_Button1 type=submit
																	value="提 交" name=ctl00$ContentPlaceHolder1$Button1
																	onclick="return checkDate();">
															</TD>
														</TR>
													--%>
														</FORM>
														
														
													</TBODY>
												</TABLE>
											</DIV>
										</TD>
									</TR>
									
																			






																										</TBODY>
																									</TABLE>
																								</DIV>
																							</TD>
																						</TR>
																					</TBODY>
																				</TABLE>
																			</td>
																		</tr>
																	</TBODY>
																</TABLE>
														</TD>
													</TR>
												</TBODY>
											</TABLE>
											<jsp:include page="../footer.jsp"></jsp:include>
	</BODY>
</HTML>
